<!--
 * @Descripttion: 
 * @version: 1.0.0
 * @Author: 孙立政
 * @Date: 2021-12-16 18:20:16
 * @LastEditors: 孙立政
 * @LastEditTime: 2021-12-16 22:03:48
-->
<template>
  <div class="xsqg-box">
    <div class="title">
      <div>
        <img
          src="https://diandi-app.oss-cn-hangzhou.aliyuncs.com/appV3/home/sc/activity/soO.png"
          alt=""
        />
      </div>
      <div class="time">
        <CountDown :time="time" class="time-assembly" format="HH:mm:ss:SS">
          <template #default="timeData">
            <span class="block">{{
              timeData.hours < 10 ? '0' + timeData.hours : timeData.hours
            }}</span>
            <span class="colon">:</span>
            <span class="block">{{
              timeData.minutes < 10 ? '0' + timeData.minutes : timeData.minutes
            }}</span>
            <span class="colon">:</span>
            <span class="block">{{
              timeData.seconds < 10 ? '0' + timeData.seconds : timeData.seconds
            }}</span>
          </template>
        </CountDown>
      </div>
    </div>
    <div class="explain">每日特价疯抢</div>
    <div class="goods">
      <Swipe vertical :show-indicators="false" :autoplay="3000" :duration="1000" :touchable="false">
        <SwipeItem class="goods-list">
          <div class="item">
            <div class="goods-img">
              <img
                src="https://diandi-app.oss-cn-hangzhou.aliyuncs.com/appV3/home/sc/activity/goods.png"
                alt=""
              />
            </div>
            <div class="price">￥66</div>
            <div class="or-price">￥66</div>
          </div>
          <div class="item">
            <div class="goods-img">
              <img
                src="https://diandi-app.oss-cn-hangzhou.aliyuncs.com/appV3/home/sc/activity/goods.png"
                alt=""
              />
            </div>
            <div class="price">￥66</div>
            <div class="or-price">￥66</div>
          </div>
        </SwipeItem>
      </Swipe>
    </div>
  </div>
</template>

<script setup lang="ts">
import { onMounted } from 'vue'
import { CountDown, Swipe, SwipeItem } from 'vant'
const time = 30 * 60 * 60 * 1000
</script>

<style lang="scss" scoped>
.xsqg-box {
  width: 100%;
  height: 320px;
  .title {
    display: flex;
    height: 45px;
    line-height: 45px;
    img {
      width: 132px;
      height: 45px;
      display: block;
    }
    .time {
      .time-assembly {
        margin-top: 3px;
        margin-left: 10px;
      }
      .colon {
        display: inline-block;
        margin: 0 4px;
        color: #ff5c47;
      }
      .block {
        display: inline-block;
        width: 50px;
        height: 32px;
        line-height: 32px;
        color: #fff;
        font-size: 23px;
        text-align: center;
        background-color: #ff5c47;
        border-radius: 8px;
      }
    }
  }
  .explain {
    font-size: 23px;
    color: #999;
  }
  .goods {
    .goods-list {
      width: 92%;
      // margin: 0 auto;
      display: flex;
      justify-content: space-between;
      img {
        width: 100%;
      }
      .goods-img {
        height: 140px;
        margin-top: 10px;
      }
      .item {
        width: 140px;
        .price {
          width: 100px;
          height: 30px;
          margin: 0 auto;
          border-radius: 15px;
          text-align: center;
          background: linear-gradient(120deg, #ff6a32 0%, #ff2b17 50%, #ff2b17 100%);
          font-size: 23px;
          color: #fff;
          margin-top: 20px;
        }
        .or-price {
          width: 100px;
          margin: 0 auto;
          text-align: center;
          font-size: 20px;
          text-decoration: line-through;
          color: #999;
        }
      }
    }
  }
}
</style>
